import { defHttp } from "@/utils/http";

// ERP 药品流通跟踪 VO
export interface DrugCTrkVO {
	id: number; // 唯一标识
	drugCode: number; // 药品编码
	quantity: number; // 流通数量
	sqNumb: number; // 序号
}

// ERP 药品流通跟踪 API
export const DrugCTrkApi = {
	// 查询药品流通跟踪分页
	getDrugCTrkPage: async (params: any) => {
		return await defHttp.get({ url: `/whs/drug-tracking/page`, params });
	},

	// 查询药品流通跟踪详情
	getDrugCTrk: async (id: number) => {
		return await defHttp.get({ url: `/whs/drug-tracking/get?id=` + id });
	},

	// 新增药品流通跟踪
	createDrugCTrk: async (data: DrugCTrkVO) => {
		return await defHttp.post({ url: `/whs/drug-tracking/create`, data });
	},

	// 修改药品流通跟踪
	updateDrugCTrk: async (data: DrugCTrkVO) => {
		return await defHttp.put({ url: `/whs/drug-tracking/update`, data });
	},

	// 删除药品流通跟踪
	deleteDrugCTrk: async (id: number) => {
		return await defHttp.delete({ url: `/whs/drug-tracking/delete?id=` + id });
	},

	// 导出药品流通跟踪 Excel
	exportDrugCTrk: async (params: any) => {
		return await defHttp.download({ url: `/whs/drug-tracking/export-excel`, params });
	}
};
